package com.github.boluo1230.wechat.feign;

import com.github.boluo1230.wechat.entity.vo.WxAccessToken;
import com.github.boluo1230.wechat.feign.fallback.WxAccessTokenAPIFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Code Farmer
 * @date 2019/10/22 10:58
 */
@FeignClient(url = "https://api.weixin.qq.com",
        value = "access-token",
        fallbackFactory = WxAccessTokenAPIFallback.class)
public interface WxAccessTokenAPI {

    /**
     * 获取AccessToken
     */
    @GetMapping("/cgi-bin/token")
    WxAccessToken getAccessToken(@RequestParam(value = "grant_type") String grantType,
                                 @RequestParam(value = "appid") String appId,
                                 @RequestParam(value = "secret") String secret);


}
